<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自定义检测低版本ie的函数</title>
</head>
<body>

</body>
<script type="text/javascript">
    var version = 9
    function isIE(version) {
        var b = document.createElement('b')
        b.innerHTML = '<!--[if IE '+version+']><i></i><![endif]-->'
        return b.getElementsByTagName('i').length === 1
    }
    console.log(isIE(version))
</script>
</html>
